﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace BrainTechLLC
{
    [Serializable]
#if NO_SILVERLIGHT
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter))]
#endif
    [DataContract]
    public class PositionAndSpeedFloat : SpeedFloat, IHasSpeedFloat, IHasLocationFloat, IPositionAndSpeedFloat, IVector4Float, IDirectionFloat, IQuickCopy
    {
        public PositionAndSpeedFloat(PositionFloat pos) : base() { Position = new PositionFloat(pos); }
        public PositionAndSpeedFloat(PositionFloat pos, SpeedFloat speed) : base(speed) { Position = new PositionFloat(pos); }
        public PositionAndSpeedFloat(SpeedFloat speed) : base(speed) { Position = new PositionFloat(); }
        public PositionFloat Position { get; set; }
        public GeneralDirection CardinalDirection { get { return DirectionVector.CardinalDirection; } }
        public IDirectionFloat GetSymmetric(Symmetry symmetry) { return DirectionVector.GetSymmetric(symmetry); }
        public ILocationFloat Location { get { return Position.Location; } }
        public IDirectionFloat DirectionVector { get { return Position.DirectionVector; } set { Position.DirectionVector = value; } }
        public PositionAndSpeedFloat() : base() { }
        public override object Copy()
        {
            PositionFloat pos = new PositionFloat(this.Position);
            return new PositionAndSpeedFloat(this) { Position = pos };
        }
    }
}
